import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);
export const asyncRouterMap = [
  {
    path: '/',
    redirect: 'dashboard',
    component: (resolve) => { require(['views/Index/index'], resolve); },
    children: [
      {
        path: 'dashboard',
        name: '首页',
        meta: {
          title: '首页'
          // keepAlive: true // 需要被缓存
        },
        component: (resolve) => { require(['views/Dashboard/dashboard'], resolve); }
      }
    ]
  },
  {
    name: '运营指标',
    path: '/menu',
    icon: 'settings',
    redirect: '/menu/produce',
    component: (resolve) => { require(['views/Index/index'], resolve); },
    children: [
      {
        path: 'produce',
        name: '成品生产成品比',
        meta: {
          title: '成品生产成品比',
          keepAlive: true // 需要被缓存
        },
        component: (resolve) => { require(['views/Analysis/analysis'], resolve); }
      },
      {
        path: 'positing',
        name: '全厂人员定位',
        meta: {
          title: '全厂人员定位',
          keepAlive: true // 需要被缓存
        },
        component: (resolve) => { require(['views/Sweeping/sweeping'], resolve); }
      },
      {
        path: 'event',
        name: '生产事件处置情况',
        component: (resolve) => { require(['views/home/homepage'], resolve); }
      },
      {
        path: 'curve',
        name: '产品产量曲线图',
        component: (resolve) => { require(['views/Detail/detail'], resolve); }
      },
      {
        path: ' transport',
        name: '久泰能源员工工作圈',
        component: (resolve) => { require(['views/Dashboard/dashboard'], resolve); }
      },
      {
        path: 'videos',
        name: '视频监控',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'handle',
        name: '应急处置预案',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'financial',
        name: '分项财务指标',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'distribution',
        name: '产品产量分布',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'Handling',
        name: 'SRS安全隐患处理',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'energy',
        name: '能源输送图示',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'Annual',
        name: '全年产品产量--当期',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'monitoring',
        name: 'DCS实时监控信息',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'scenefour',
        name: '场景四',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'hiddenzone',
        name: '隐患区域',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'situation',
        name: '员工情况',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'scenethree',
        name: '场景三',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'economic',
        name: '经济指标',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'distribution',
        name: '产品销往地分布',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'scenetwo',
        name: '场景二',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'sceneone',
        name: '场景一',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'consumption',
        name: '能耗比',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'securityfocus ',
        name: '安全重点关注点位',
        component: (resolve) => { require(['views/Video/video'], resolve); }
      }
    ]
  },
  {
    name: '系统管理',
    path: '/system',
    icon: 'gear-a',
    redirect: '/menu/produce',
    component: (resolve) => { require(['views/Index/index'], resolve); },
    children: [
      {
        path: 'systemmenu',
        name: '系统菜单管理',
        meta: {
          title: '系统菜单管理',
          keepAlive: true // 需要被缓存
        },
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'rolemenu',
        name: '角色管理',
        meta: {
          title: '角色管理',
          keepAlive: true // 需要被缓存
        },
        component: (resolve) => { require(['views/Video/video'], resolve); }
      },
      {
        path: 'accountmenu',
        name: '账号管理',
        meta: {
          title: '账号管理',
          keepAlive: true // 需要被缓存
        },
        component: (resolve) => { require(['views/Video/video'], resolve); }
      }
    ]
  },
  {
    path: '*',
    name: '404-页面不存在',
    component: (resolve) => { require(['views/404/404'], resolve); }
  }
];

export default new Router({
  // mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: asyncRouterMap
});
